package model.dao;

import java.sql.ResultSet;

import model.pojo.Employee;
import model.util.MySqlDataAccessHelper;

public class ACEmployeeDAO {
	public static Employee getEmployee(String id){
		Employee em = null;
		MySqlDataAccessHelper mysql = new MySqlDataAccessHelper();
		String sql = "SELECT * FROM employee WHERE IDEmployee ='" +id+"'";
		try {
			mysql.open();
			ResultSet rs = mysql.executeQuery(sql);
			rs.next();
			em = new Employee(rs.getString("IDEmployee"), rs.getString("FullName"), rs.getString("UserName"),rs.getInt("IDDepartment"));
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
			mysql.close();
		}
		return em;
	}
}
